export const ListSchema = {
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://example.com/mate-config-schema.json?a=c",
  "title": "Mate Configuration Schema",
  "description": "配置表单和列表的元数据定义",
  "type": "object",
  "properties": {
    "mateForm": {
      "type": "array",
      "description": "表单配置，支持多行布局",
      "items": {
        "type": "array",
        "description": "表单行，每行包含多个表单项",
        "items": {
          "type": "object",
          "description": "表单项配置",
          "properties": {
            "type": {
              "type": "string",
              "description": "表单项类型",
              "enum": ["select", "text", "textarea", "radio", "checkbox", "date", "datetime"],
              "default": "input",
              "examples": ["select", "text"]
            },
            "label": {
              "type": "string",
              "description": "表单项标签",
              "minLength": 1
            },
            "codeFrom": {
              "type": "object",
              "description": "数据来源配置",
              "properties": {
                "from": {
                  "type": "string",
                  "description": "数据来源标识",
                  "minLength": 1
                },
                "codeIn": {
                  "type": "array",
                  "description": "包含的代码值",
                  "items": {
                    "type": "string"
                  },
                  "default": []
                },
                "codeNotIn": {
                  "type": "array",
                  "description": "排除的代码值",
                  "items": {
                    "type": "string"
                  },
                  "default": []
                }
              },
              "required": ["from"],
              "additionalProperties": false
            },
            "property": {
              "type": "string",
              "description": "对应的数据字段名",
              "minLength": 1,
              "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$"
            },
            "placeholder": {
              "type": "string",
              "description": "占位符文本"
            },
            "required": {
              "type": "boolean",
              "description": "是否必填",
              "default": false
            },
            "disabled": {
              "type": "boolean",
              "description": "是否禁用",
              "default": false
            },
            "rules": {
              "type": "array",
              "description": "验证规则",
              "items": {
                "type": "object"
              }
            }
          },
          "required": ["type", "label", "property"],
          "additionalProperties": false
        }
      }
    },
    "mateList": {
      "type": "array",
      "description": "列表列配置",
      "items": {
        "type": "object",
        "description": "列配置项",
        "properties": {
          "label": {
            "type": "string",
            "description": "列标题",
            "minLength": 1
          },
          "width": {
            "type": "integer",
            "description": "列宽度",
            "minimum": 1,
            "maximum": 1000
          },
          "property": {
            "type": "string",
            "description": "对应的数据字段名",
            "minLength": 1,
            "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$"
          },
          "codeFrom": {
            "type": "object",
            "description": "数据来源配置",
            "properties": {
              "from": {
                "type": "string",
                "description": "数据来源标识",
                "minLength": 1,
              },
              "codeIn": {
                "type": "array",
                "description": "包含的代码值",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "codeNotIn": {
                "type": "array",
                "description": "排除的代码值",
                "items": {
                  "type": "string"
                },
                "default": []
              }
            },
            "required": ["from"],
            "additionalProperties": false
          },
          "codeType": {
            "type": "string",
            "description": "代码显示类型",
            "enum": ["tag"],
            "default": "text",
            "examples": ["tag"]
          },
          "sortable": {
            "type": "boolean",
            "description": "是否可排序",
            "default": false
          }
        },
        "required": ["label", "property"],
        "additionalProperties": false
      }
    }
  },
  "required": ["mateForm", "mateList"],
  "additionalProperties": false
}